﻿using Microsoft.AspNetCore.Mvc;

namespace TestApi.Controllers;

/// <summary>
/// 用户
/// </summary>
[ApiController,Route("api/[controller]"),ApiExplorerSettings(GroupName = "v2")]
public class UserController : ControllerBase
{
    /// <summary>
    /// 获得
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    public IActionResult Get(Param param)
    {
        return Ok("Get");
    }
    
    
    /// <summary>
    /// 添加
    /// </summary>
    /// <returns></returns>
    [HttpPost]
    public IActionResult Post([FromQuery]Param param,[FromBody]WeatherForecastController.MyClass model)
    {
        return Ok("Post");
    }
    
    /// <summary>
    /// 添加
    /// </summary>
    /// <returns></returns>
    [HttpPost("Student")]
    public WeatherForecastController.MyStudent PostStudent([FromQuery]Param param,[FromBody]WeatherForecastController.MyClass model)
    {
        return new WeatherForecastController.MyStudent();
    }
    
    /// <summary>
    /// 修改
    /// 第二行注释
    /// </summary>
    /// <returns></returns>
    [HttpPut]
    public IActionResult Put()
    {
        return Ok("Put");
    }
    
    [HttpDelete]
    public IActionResult Delete()
    {
        return Ok("Delete");
    }
    
    /// <summary>
    /// 参数
    /// </summary>
    public class Param
    {
        /// <summary>
        /// 关键字
        /// </summary>
        public string Key { get; set; }
        
        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }
    }
}